﻿using System.Collections.Generic;

namespace FluentBinding.WinForms.Domain
{
    public class Countries
    {
        #region Fields

        private readonly Country _austria
            = new Country { Name = "Austria" , Code = "AT" };

        private readonly Country _australia
            = new Country {Name = "Australia", Code = "AU", City = new City {Name = "Sydney"}};

        private readonly Country _italy
            = new Country {Name = "Italy", Code = "IT", City = new City {Name = "Rome"}};

        private readonly Country _usa
            = new Country {Name = "USA", Code = "US", City = new City {Name = "Boston"}};

        #endregion

        #region Public properties

        public Country Austria
        {
            get { return _austria; }
        }

        public Country Australia
        {
            get { return _australia; }
        }

        public Country Italy
        {
            get { return _italy; }
        }

        public Country USA
        {
            get { return _usa; }
        }

        public IEnumerable<Country> All
        {
            get
            {
                yield return _austria;
                yield return _australia;
                yield return _italy;
                yield return _usa;
            }
        }

        #endregion
    }
}